package com.heima.apis.article;

import com.heima.apis.article.fallback.IArticleClientFallBack;
import com.heima.model.article.dtos.ArticleCommentDto;
import com.heima.model.article.dtos.ArticleDto;
import com.heima.model.comment.dtos.CommentConfigDto;
import com.heima.model.common.dtos.PageResponseResult;
import com.heima.model.common.dtos.ResponseResult;
import com.heima.model.wemedia.dtos.StatisticsDto;
import com.heima.model.wemedia.dtos.WmStatisticDto;
import com.heima.model.wemedia.vos.WmStatisticsVOs;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;

@FeignClient(value = "leadnews-article",fallback = IArticleClientFallBack.class)
public interface IArticleClient {

    /**
     * 审核通过 保存文章
     * @param dto
     * @return
     */
    @PostMapping("/api/v1/article/save")
    public ResponseResult saveArticle(ArticleDto dto);


    /**
     * 查询文章是否可以评论
     * @param articleId
     * @return
     */
    @GetMapping("/api/v1/article/findArticleConfigByArticleId/{articleId}")
    public ResponseResult findArticleConfigByArticleId(@PathVariable("articleId") Long articleId);


    /**
     * 自媒体端查询文章表的信息
     * @param dto
     * @return
     */
    @PostMapping("/api/v1/article/findNewsComments")
    public PageResponseResult findNewsComments(@RequestBody ArticleCommentDto dto);


    /**
     * 修改app文章的config配置
     * @param dto
     * @return
     */
    @PostMapping("/api/v1/article/updateCommentStatus")
    public ResponseResult updateCommentStatus(@RequestBody CommentConfigDto dto);

    /**
     * 获取图文数据
     * @param dto
     * @return
     */
    @PostMapping("/api/v1/article/queryLikesAndConllections")
    ResponseResult queryLikesAndCollections(@RequestBody WmStatisticDto dto);


    /**
     * 分页查询图文统计
     * @param dto
     * @return
     */
    @PostMapping("/api/v1/article/newPage")
    PageResponseResult newPage(@RequestBody StatisticsDto dto);
}
